home *** CD-ROM | disk | FTP | other *** search
/ Workbench Design / WB Collection.iso / workbench werkzeuge / reset tools / resethandler / resethandler.doc < prev    next >
Text File  |  1996-04-07  |  9KB  |  219 lines

  1. ResetHandler V1.01 by FtC of eFS
  2. --------------------------------
  3.  
  4. A program that let's you execute DOS commands and/or display a warning when
  5. the user triggers a keyboard RESET.
  6.  
  7. 1. Introduction
  8. ---------------
  9.  
  10. "Well, to access the WordWrap function in my new text editor, I have to
  11. press CTRL-W-left Amiga-right Alt..." <BOUM> "... Rats! I've pressed right
  12. Amiga instead of right Alt! And now my text is lost!"
  13.  
  14. If things like this happen often to you, ResetHandler is the right program
  15. for you.
  16.  
  17. But also if you hate the fact that you have to quit manually certain
  18. programs every time before you reset, you should take a look at
  19. ResetHandler.
  20.  
  21. But be aware: Contrary to IBM PC computers and clones (YEEK!), the keyboard
  22. reset of the Amiga *can't* be stopped, it can only be delayed. About 10
  23. seconds after you've pressed the three magic keys, your Amiga will reset,
  24. no matter what happens. So don't blame me when you resetted your Amiga,
  25. realised your mistake, and tried to save the 100kb text you've been writing
  26. to floppy.
  27.  
  28. However, if you owned a fast hard drive, it could have worked :-)
  29.  
  30. 2. Usage
  31. --------
  32.  
  33. Before I explain the usage of ResetHandler, one thing first: This program
  34. will *not* run on all Amigas. Commodore designed the reset logic on the
  35. A500 (and perhaps other ones) differently than on the A1000, A2000, A4000
  36. etc. ResetHandler will "run" on any Amiga equipped with at least Kickstart
  37. 2.0, but it won't do anything useful on an A500 (as well as A1000s and very
  38. old Amiga 2000s). There's nothing that can fix this "bug", it's hardware.
  39. Blame Commodore, not me.
  40.  
  41. As I really don't know if it runs on A600s and A4000s, you can do nothing
  42. but test it. Please report me (address at the end of the doc file) if it
  43. works or not if you are using such a machine. Better, if you happen to own
  44. an A4000 which you don't need anymore, send it to me :-)
  45.  
  46. To activate ResetHandler, start it. If you run it from the Shell (CLI), you
  47. have to RUN it (no auto-detaching code), but it can also be run from the
  48. Workbench. Copying it in your WBStartup drawer, setting the tool types and
  49. forgetting all about it is perhaps the easiest way to use it.
  50.  
  51. Started from the shell, its template looks like this:
  52.  
  53. ResetHandler ShutDownCommand,Wait/N,Warn/S
  54.  
  55. ShutDownCommand: This is the DOS command to execute when you trigger a
  56. keyboard reset. A script containing the DOS commands used to quit your
  57. constantly-running-applications will be appropriate most of the time, I
  58. think. Don't forget to prepend the name of the script with "Execute" in
  59. that case (example below).
  60.  
  61. This argument defaults to "Execute S:ShutDown-Sequence". If you don't want
  62. ResetHandler to execute anything, you have to specify "nothing", as in
  63.  
  64.     ResetHandler ""
  65.  
  66. Wait: This argument accepts a number which will be used as a delay after
  67. the DOS command has finished. This is meant to be used without the Warn
  68. option to give your hard drive some time to finish it's writing, for
  69. example. Note however that you've got only 10 (ten) seconds time after
  70. you've triggered the reset, so larger values than, say, 6 won't be of a big
  71. use.
  72.  
  73. Warn: This switch tells ResetHandler to put up a requester that tells you
  74. that you have resetted your Amiga. It is useful in case you want be given
  75. a chance to do some cleanup "by hand".
  76.  
  77. Examples:
  78.  
  79.  1> Run ResetHandler "" Warn
  80.  
  81. This will start ResetHandler. When you press ctrl-lamiga-ramiga while
  82. ResetHandler is still running, it will pop up a requester telling you about
  83. what you've done and offering you the choice of resetting your Amiga or
  84. waiting. Remember that after you've triggered the reset, a hardware
  85. controlled 10-seconds timer starts to tick which *will* reset your Amiga,
  86. no matter what happens! So don't stare at the requester for too long, but
  87. either hurry and choose the "save" button of your word processor and pray
  88. that it will finish the "save" in less than 10 seconds, or press the button
  89. "Reset NOW!" on the requester and let it go.
  90.  
  91.  1> Run ResetHandler Wait 4
  92.  
  93. With "S:ShutDown-Sequence" containing something like this:
  94. -----------8<--------------8<--------------8<--------------8<------------
  95. FailAt 99999
  96. C:CliExchange Kill MailManager
  97. Mail:bin/TrapTell Quit
  98. rx "Address Spot;QuitSpot NoReq"
  99. C:Cronevent q
  100. ----------->8-------------->8-------------->8-------------->8------------
  101. (which is, incidentially, my personal config)
  102.  
  103. This will start ResetHandler. When you trigger a keyboard reset,
  104. ResetHandler will execute this script, which will close
  105. (***commercial presentation***) MailManager, TrapDoor, Spot and TPTCron
  106. (***commercial presentation finished***) :-)
  107.  
  108. After the script has finished, ResetHandler waits 4 seconds (to allow the
  109. hard drive to finish its writing) and finally, it will reset your Amiga.
  110.  
  111. When you start ResetHandler from the workbench, you have to supply the
  112. arguments as tool types (just look at the icon contained in the archive).
  113. To disable the ShutDownCommand here, you have to specify a
  114. "ShutDownCommand=" tooltype (that is, nothing after the equals sign)
  115.  
  116. When ResetHandler is running, you can quit it by either send a CTRL-C or
  117. CTRL-D to its process, or you cann kill it using Commodities Exchange.
  118. Using Exchange, you can also "Inactivate" and "Activate" ResetHandler as
  119. much as you wish :-)
  120.  
  121. However, remember that ResetHandler will quietly let a reset happen when
  122. it's "inactive", and it won't do anything when you've killed it (really!) :-)
  123.  
  124. If you run ResetHandler while it's already installed, it will terminate
  125. itself.
  126.  
  127. 3. Why did I write this?
  128. ------------------------
  129.  
  130. Well, there was a friend of mine (Hi Denis!) who asked me if it's possible
  131. to prevent a keyboard reset on the Amiga. I answered "no, but..." and he
  132. had the idea of ResetHandler. So I did.
  133.  
  134. Wasn't a bad idea!
  135.  
  136. 4. To do
  137. --------
  138.  
  139. Anyone has any ideas?
  140.  
  141. 5. Bugs
  142. -------
  143.  
  144. This program is written in a fully system friendly way. It uses
  145. keyboard.device's ResetHandler system (hence the name), and absolutely no
  146. hardware hacks. It shouldn't, under any circumstances, crash or cause
  147. directly any data loss. But remember that it may cause a DOS command to run
  148. while a reset occurs (if the DOS command runs long enough), which may even
  149. physically damage your hard disk. There's nothing you can do about this.
  150.  
  151. Anyway, all programs have bugs. I didn't find any, but that doesn't mean
  152. anything. So if you find your Amiga behaves quite unusual, report the bug
  153. to me, please. I'll try to fix it ;-)
  154.  
  155. Note again that this program *can't* work on A500s because their reset
  156. hardware is constructed *differently* from the hardware of other Amigas.
  157. This program works on A2000s and is reported to work on A1200s, but
  158. don't know about other Amigas. However, it should at least work on the "big
  159. box" Amigas (A3000, A4000). Don't blame me!
  160.  
  161. 6. Disclaimer
  162. -------------
  163.  
  164. This program is © 1995 by FtC of EfS. All rights reserved. You may
  165. distribute this program as you like, but don't charge any money except some
  166. nominal fee for media. If this program does any harm to your hamster, your
  167. gold fish, your grandma or - most probably - your Amiga, I don't take any
  168. responsibility for it.
  169.  
  170. And don't send me an assault command (or a letter bomb) if the 10 second
  171. timeout occured while you were writing your 100kb textfile to your floppy
  172. (thus damaging it permanently). I'm not responsible for this timeout
  173. either.
  174.  
  175. Donations (beer, girls, netmails, money, emails, amigas, ISDN cards,
  176. postcards, harddisks etc., no cars please - I can't drive) are always
  177. welcome.
  178.  
  179.  
  180. 7. The source
  181. -------------
  182.  
  183. I release the source code together with the program, but please don't tell
  184. me that my programming style is terrible: I already know it.
  185.  
  186. To compile it, you'll need Wouter van Oortsmerssen's excellent E compiler.
  187. It should compile without any problems under the demo version of EC 3.1a or
  188. newer, but a registered version won't hurt either :-)
  189.  
  190. 8. History
  191. ----------
  192. 131195  1.0   First released version
  193. 151295  1.01  Modified default behaviour to "Execute S:Shutdown-Sequence"
  194.               instead of putting up the requester
  195.               Changed the "NoWarn" switch and tooltype to the "Warn" one,
  196.               which incidentially means the opposite :-)
  197.  
  198. 9. Contacting the author
  199. ------------------------
  200.  
  201. I can be contacted the following ways:
  202.  
  203. Internet: ftc@p6.thotp.fn.alphanet.ch
  204.           max124@g26.ethz.ch            (sometimes faster)
  205.  
  206.  Fidonet: 2:301/317.6
  207. Amiganet: 39:110/311.6
  208.  
  209. If you don't have any access to electronic mail, you may reach me at my postal
  210. address:
  211.  
  212.    Andreas Trottmann
  213.    Kronengasse 7
  214. CH-5400 Baden
  215.  
  216.    SWITZERLAND
  217.  
  218. Enjoy ResetHandler!
  219.